/*
 * TeacherAddress.cpp
 *
 *  Created on: 19 ��� 2010
 *      Author: Sartios
 */

#include "TeacherAddress.h"

#include "../../../Addresses/Address/Address.h"
#include "../../../Teachers/Teacher/Teacher.h"

TeacherAddress::TeacherAddress() {
	teacher_ = NULL;
	address_ = NULL;
}

TeacherAddress::TeacherAddress(const IAddress *address,const ITeacher *teacher){
	if((NULL!=address)&&(NULL!=teacher)){
		setTeacher(teacher);
		setAddress(address);
	}
}

TeacherAddress::TeacherAddress(const ITeacher *teacher,const IAddress *address){
	if((NULL!=address)&&(NULL!=teacher)){
		setTeacher(teacher);
		setAddress(address);
	}
}

TeacherAddress::~TeacherAddress() {
	delete teacher_;
	delete address_;
}

void TeacherAddress::setTeacher(const ITeacher *teacher){
	if(NULL!=teacher){
		teacher_ = new Teacher(teacher);
	}
}

ITeacher *	TeacherAddress::getTeacher(void)const{
	if(NULL!=teacher_){
		return teacher_;
	}
	return NULL;
}

void	TeacherAddress::setAddress(const IAddress *address){
	if(NULL!=address){
		address_ = new Address(address);
	}
}

IAddress * TeacherAddress::getAddress()const{
	return address_;
}
